﻿/********************************************************************************
 * Developed by Phil Tyler (http://www.laidbackcoder.co.uk)
 * 
 * Cryptosolic is Licensed under the GNU Lesser General Public License (LGPL)
 * http://cryptosolic.codeplex.com/license
 * *****************************************************************************/
using NUnit.Framework;
using Cryptosolic.Security.Hashing;

namespace Cryptosolic.Security.Tests
{
    [TestFixture]
    public class Sha512HashingTests : HashingTestsBase
    {      
        [SetUp]
        public void Setup()
        {
            base.hashAlgorithm = new Sha512();
        }

        [Test]
        public void Sha512_HashData_OutputHashDifferentFromInput()
        {
            base.assert_HashData_OutputHashDifferentFromInput();
        }

        [Test]
        public void Sha512_HashData_OutputHashRepeatable()
        {
            base.assert_HashData_OutputHashRepeatable();
        }

        [Test]
        public void Sha512_HashData_OutputHashDifferentWithTwoSimilarInputs()
        {
            base.assert_HashData_OutputHashDifferentWithTwoSimilarInputs();
        }

        [Test]
        public void Sha512_HashData_OutputHashSameAsKnownHash()
        {
            //Expected String from http://www.fileformat.info/tool/hash.htm?text=this.is.a.test
            //and verified using http://www.tools4noobs.com/online_tools/hash/
            string expected = "6f634202a30fc2b07be653107013f0bf6ba3d69c444cf656cd5dc4f3acff5f2121f9107adf3b496b78c51bce7e371e768a8080d1f9cab268ffc67ced64775413";
            
            base.assert_HashData_OutputHashSameAsKnownHash(expected);
        }
    }
}
